﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Method
{
    public class GameMoves
    {
        private IEnumerator cross;
        private IEnumerator circle;
        
        public GameMoves()
        {
            cross = Cross(); 
            circle = Circle();
        }

        private int move = 0;
        private int MaxMoves = 9;

        public IEnumerator Cross()
        {
            while(true)
            {
                Console.WriteLine("Cross,move {0}", move);
                if (++move >= MaxMoves)
                    yield break;
                yield return circle;
            }
        }

        public IEnumerator Circle()
        {
            while (true)
            {
                Console.WriteLine("Circle,move {0}", move);
                if (++move >= MaxMoves)
                    yield break;
                yield return cross;
            }
        }

    }
}
